<template>
  <div class="box">
    <van-nav-bar title="系统设置"  left-arrow @click-left="onClickLeft" />
    <div class="nav">
      <div class="nl">头像

      </div>
      <div class="nr">
        <img src="../.././img/img1.png" alt="">
        <van-icon name="arrow" class="icon" />
      </div>
    </div>
    <div class="content">
      <div class="cl">昵称</div>
      <div class="cr">{{ userInfo.nickname }}
        <van-icon name="arrow" class="icn" size="20" />
      </div>
    </div>

    <div class="ban">
      <div class="cl">账号设置</div>
      <div class="cr">
        <van-icon name="arrow" class="icn" size="20" />
      </div>
    </div>

    <div class="bann">
      <div class="cl">隐私</div>
      <div class="cr">
        <van-icon name="arrow" class="icn" size="20" />
      </div>
    </div>

    <div class="ben">
      <div class="cl">当前版本</div>
      <div class="cr">4.0.0</div>
    </div>


    <van-button block class="btn" @click="del">退出登录</van-button>



  </div>
</template>

<script setup lang="ts">
  import {
    useRouter
  } from 'vue-router';
  const router = useRouter()
  const onClickLeft = () => {
    router.back()
  }
  const del = () => {

    localStorage.removeItem('userInfo')
 
    router.push('/order')

  }
  const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}')

</script>

<style lang="scss" scoped>
  .box {
    width: 100vw;
    height: 100vh;
    background: rgb(209, 206, 206)dbd;

    .nav {
      width: 100%;
      height: 80px;
      display: flex;
      background: #fff;

      .nl {
        margin-left: 10px;
        line-height: 100px;
        color: #333;
        font-size: 18px;
      }

      .nr {
        margin-left: 120px;

        img {
          width: 50px;
          height: 50px;
          border-radius: 50%;
          position: absolute;
          right: 40px;
          top: 68px;
        }

        .icon {
          font-size: 24px;
          color: #999;
          position: absolute;
          right: 10px;
          top: 80px;

        }
      }
    }

    .content {
      display: flex;
      width: 100%;
      height: 50px;
      .cl{
        width: 100px;
        margin-left: 10px;
        font-size: 16px;
         line-height: 50px;

      }
      .cr{
        margin-left: 180px;
        line-height: 50px;
        color: #999;
        font-size: 18px;
      }

     

     
    }

    .ban {
      display: flex;
      background: #fff;
      margin-top: 20px;

      .cl {
        margin-left: 10px;
        line-height: 50px;
        color: #333;
        font-size: 18px;
      }

      .cr {
        margin-left: 260px;
        line-height: 50px;
        color: #999;
        font-size: 18px;

      }
    }
  }


  .btn {
    margin-top: 20px;

  }
  .ben{
    display: flex;
      background: #fff;
      margin-top: 20px;
    .cl {
        margin-left: 10px;
        line-height: 50px;
        color: #333;
        font-size: 18px;
      }

      .cr {
        margin-left: 220px;
        line-height: 50px;
        color: #999;
        font-size: 18px;

      }

  }
  .bann{
       display: flex;
      background: #fff;
     
      .cl {
        margin-left: 10px;
        line-height: 50px;
        color: #333;
        font-size: 18px;
      }

      .cr {
        margin-left: 295px;
        line-height: 50px;
        color: #999;
        font-size: 18px;

      }
  }

</style>
